package com.design.mediator.smartcontrol;

// 具体中介者类
class SmartHomeControlCenter implements SmartHomeMediator {
    private SmartLight smartLight;
    private SmartThermostat smartThermostat;
    private SmartSoundSystem smartSoundSystem;

    public void setSmartLight(SmartLight smartLight) {
        this.smartLight = smartLight;
    }

    public void setSmartThermostat(SmartThermostat smartThermostat) {
        this.smartThermostat = smartThermostat;
    }

    public void setSmartSoundSystem(SmartSoundSystem smartSoundSystem) {
        this.smartSoundSystem = smartSoundSystem;
    }

    @Override
    public void turnOffLights() {
        smartLight.turnOff();
    }

    @Override
    public void adjustTemperature() {
        smartThermostat.setTemperature(20); // Set temperature to 20°C
    }

    @Override
    public void turnOffSoundSystem() {
        smartSoundSystem.turnOff();
    }
}
